package com.sunny.fetch.pojo;

import javax.persistence.*;

@Table(name = "sun_url")
public class SunUrl {
    @Id
    @Column(name = "url_id")
    private Long urlId;

    /**
     * url取hash结构
     */
    @Column(name = "url_hash")
    private Long urlHash;

    /**
     * url
     */
    @Column(name = "url_str")
    private String urlStr;

    private String comment;

    public SunUrl(Long urlId, Long urlHash, String urlStr, String comment) {
        this.urlId = urlId;
        this.urlHash = urlHash;
        this.urlStr = urlStr;
        this.comment = comment;
    }

    public SunUrl() {
        super();
    }

    /**
     * @return url_id
     */
    public Long getUrlId() {
        return urlId;
    }

    /**
     * @param urlId
     */
    public void setUrlId(Long urlId) {
        this.urlId = urlId;
    }

    /**
     * 获取url取hash结构
     *
     * @return url_hash - url取hash结构
     */
    public Long getUrlHash() {
        return urlHash;
    }

    /**
     * 设置url取hash结构
     *
     * @param urlHash url取hash结构
     */
    public void setUrlHash(Long urlHash) {
        this.urlHash = urlHash;
    }

    /**
     * 获取url
     *
     * @return url_str - url
     */
    public String getUrlStr() {
        return urlStr;
    }

    /**
     * 设置url
     *
     * @param urlStr url
     */
    public void setUrlStr(String urlStr) {
        this.urlStr = urlStr;
    }

    /**
     * @return comment
     */
    public String getComment() {
        return comment;
    }

    /**
     * @param comment
     */
    public void setComment(String comment) {
        this.comment = comment;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", urlId=").append(urlId);
        sb.append(", urlHash=").append(urlHash);
        sb.append(", urlStr=").append(urlStr);
        sb.append(", comment=").append(comment);
        sb.append("]");
        return sb.toString();
    }
}